<!DOCTYPE html>
<html lang="en">

<head>
    <script src="https://unpkg.com/axios@0.24.0/dist/axios.min.js"></script>
</head>

<body>
    <input id="fileInput" type="file" multiple />
    <script>
        const fileInput = document.querySelector('#fileInput')

        async function formData() {
            const data = new FormData()
            data.set('name', 'Yun')
            data.set('age', 20)
            data.set('formdataFiile', fileInput.files[0])
            console.log(fileInput.files[0])
            const res = await axios.post('http://localhost:3000/api/file/formdataFiile', {
                data
            },
                // {
                //     headers: { 'content-type': 'multipart/form-data' },
                // }

            )
            console.log(res)
        }

        fileInput.onchange = formData
    </script>
</body>

</html>